package cn.service.marketingService.MarketingServiceImpl;

import cn.service.marketingService.SpecialService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import entity.Result;
import entity.marketingEntity.SpecialCondition;
import entity.marketingEntity.SpecialShow;
import mapper.marketingMapper.SpecialMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author 朱颢阳
 * @description
 * @time 2024/8/30 14:00
 */
@Service
public class SpecialServiceImpl implements SpecialService {
    @Resource
    SpecialMapper mapper;

    @Override
    public Result getspecials(SpecialCondition condition) {
        PageHelper.startPage(condition.getCurrentPage(),condition.getPageSize());
        Page<SpecialShow> page= (Page<SpecialShow>) mapper.getspecials(condition);
        return Result.success((int)page.getTotal(),page.getResult());
    }
}
